package com.example.demo.design.abstractFactory;

/**
 * @className: ColorFactory
 * @copyright: Copyright (C) 2019-2028, Inc. All rights reserved.
 * @company: 中兴新云.财务云
 * @author: 刘凯
 * @date: 2024/7/3
 * @Description: com.example.demo.design.abstractFactory
 */
public  class ColorFactory extends AbstractFactory{

    @Override
    Shape getShape(String shape) {
        return null;
    }

    Color getColor(String color){
         if(color == null){
           return null;
         }
         if (color.equalsIgnoreCase("RED")) {
             return new Red();
         }else if(color.equalsIgnoreCase("GREEN")){
             return new Green();
         }else if(color.equalsIgnoreCase("BLUE")){
             return new Blue();
         }
         return null;
     }
}
